/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.oa.dao;

import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.oa.entity.Budget;
import com.thinkgem.jeesite.modules.oa.entity.BudgetSubject;
import com.thinkgem.jeesite.modules.oa.entity.Subject;
import com.thinkgem.jeesite.modules.oa.entity.TestAudit;
import com.thinkgem.jeesite.modules.sys.entity.Category;

import java.util.List;

/**
 * 预算管理DAO接口
 * @author Michael
 * @version 2017-07-31
 */
@MyBatisDao
public interface BudgetDao extends CrudDao<Budget> {
    public Budget getByProcInsId(String procInsId);

    public int updateInsId(Budget budget);

    public int updateDuatyText(Budget budget);

    public int updateAuditText(Budget budget);

    public int updateAggregate(Budget budget);
    public int updateCollectText(Budget budget);

    public void insertBudgetSubject(List<BudgetSubject> list);
    public void insertBudgetSubjectHistory(List<BudgetSubject> list);

    public void deleteBudgetSubject(Budget budget);
    public List<Subject> findBudgetSubject(Budget budget);
    public List<Subject> findBudgetSubjectHistory(Budget budget);
    public List<Subject> findThirdLevelStatistics(Budget budget);
    public List<Subject> findClassifyStatistics(Budget budget);

    /*查询某个部门及其以下的用户的预算申请*/
    List<Budget> getBudgetList(Budget budget);
    Double getBudgetListSum(Budget budget);
    /**
     * 查询某个部门用户的预算申请，不包括子部门
     * @return
     */
    List<Budget> getOfficeBudgetList(Budget budget);
    Double getOfficeBudgetListSum(Budget budget);
    List<Budget> getBudgetListByCreateUser(Budget budget);
    Double getBudgetListByCreateUserSum(Budget budget);
    List<Budget> findAggregateGroupByClassify(Budget budget);

    Double findBudgetSum(Budget budget);
}